<?php

/**
 * Subclass for representing a row from the 'clients' table.
 *
 * 
 *
 * @package lib.model
 */ 
class Clients extends BaseClients
{

	/**
	 * Array of countries
	 */
	protected static $m_arCountries = null;
	
	/**
	 * Returns status name in EN
	 *
	 * @return string
	 */
	public function getStatusName()
	{
		return MyConstants::getStatusName($this->status_id);
	}
	
	/**
	 * Returns country full name
	 *
	 * @return string
	 */
	public function getCountryName()
	{
		if( self::$m_arCountries == null )
		{
	        $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());
	        self::$m_arCountries = $c->getCountries();
		}
		
		return empty(self::$m_arCountries[$this->country_code]) ? $this->country_code : self::$m_arCountries[$this->country_code];
	}
	
	public function hydrate(ResultSet  $rs, $startcol = 1)
	{
		$this->setCulture(sfContext::getInstance()->getUser()->getCulture());
		parent::hydrate($rs, $startcol);
	}
	
}
